﻿using Microsoft.Phone.Controls;
using System;
using System.Diagnostics;
using System.Windows.Controls;
using System.Windows.Data;

namespace Coding4Fun.MissionControl.WP.Converters
{
    public class TypeToItemsPanel : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value != null)
            {
                string stVal = value.ToString();
                if (stVal.ToLower() == "pad")
                    return App.Current.Resources["WrapPanelTemplate"];
                else
                    return App.Current.Resources["StackPanelTemplate"];
            }
            else
            {
                return null;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
